package com.zhinan.controller;

import com.zhinan.annotion.CustomOutPut;
import com.zhinan.entity.Menu;
import com.zhinan.service.MenuService;
import com.zhinan.service.impl.MenuServiceImpl;
import com.zhinan.vo.MenuVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 有关菜单的控制层
 * @Author: ZhiNan
 * @Date: 2023-04-07 15:11
 * @Version: 1.0
 */
@Slf4j
@RestController
@RequestMapping("/menu")
@Api(tags = "菜单信息API", description = "提供首页侧边栏菜单信息相关的API")
public class SysMenuController {

    @Resource
    private MenuServiceImpl menuService;

    /**
     * 查询菜单
     */
    @ApiOperation(value = "侧边栏菜单查询")
    @GetMapping("/selectIndexMenu")
    @ResponseBody
    public List<MenuVo> selectIndexMenu(Menu menu) {
        return menuService.selectIndexMenu(menu);
    }
}
